<?php
require_once("vcl/vcl.inc.php");
require_once("lib/db_connection.php");
//Includes
use_unit("forms.inc.php");
use_unit("extctrls.inc.php");
use_unit("stdctrls.inc.php");

//Class definition
class Unit1 extends Page
{
       public $hfRouExp = null;
       public $hiddenExpense = null;
       public $hiddenVeh = null;
       function Unit1Create($sender, $params)
       {
       $id = $_GET['veh'];
       $this->hiddenVeh->setValue($id);
       $expense = $_GET['expense'];
       $this->hiddenExpense->setValue($expense);
       $rou_exp = $_GET['rou_exp'];
       $this->hfRouExp->setValue($rou_exp);

       $result = mysql_query("delete from veh_expense_tbl where payment_id='".$this->hiddenExpense->getValue()."'");
       $result_rou_exp = mysql_query("DELETE FROM rou_expense_tbl WHERE expense_id='".$this->hfRouExp->getValue()."'") or die ('DELETE ROU_EXP - ' . mysql_error());
       redirect('details_emission2.php?layer=1&veh='.$this->hiddenVeh->getValue());


       }

}

global $application;

global $Unit1;

//Creates the form
$Unit1=new Unit1($application);

//Read from resource file
$Unit1->loadResource(__FILE__);

//Shows the form
$Unit1->show();

?>